[api][spark] Add REST permission and data policy management - #9377
Draft
JingsongLi wants to merge 8 commits into
Draft
[api][spark] Add REST permission and data policy management#9377JingsongLi wants to merge 8 commits into
JingsongLi wants to merge 8 commits into
Conversation
JingsongLi
marked this pull request as ready for review
August 25, 2026 01:03
JingsongLi
marked this pull request as draft
August 25, 2026 05:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Add an experimental, language-neutral REST management contract for permission assignments and table data policies, and expose it to Spark through catalog procedures. Management is provided directly by
RESTCatalogwithout changing the genericCataloginterface.Permission paths are
/v1/{prefix}/permissions,/grant, and/revoke. Row-filter and column-mask policies are attached below/v1/{prefix}/databases/{database}/tables/{table}/policies. Hereprefixis the REST Catalog server prefix, not a catalog name or catalog identifier in the permission hierarchy.Data policies only restrict reads that the caller is already authorized to perform; they do not grant table access.
Changes
RESTApi, and exposepermissionManagement()andpolicyManagement()directly fromRESTCatalog.CALLprocedures for granting, listing, and revoking permissions, and for creating, replacing, listing, and dropping data policies.PagedListcontract: each list call returns one page, and an empty page terminates pagination.Tests
mvn -pl paimon-api -Dtest=PermissionManagementJsonTest,RESTPolicyManagementTest,RESTPermissionManagementTest,HttpClientRetrySafetyTest,RequestJacksonCompatibilityTest testmvn -pl paimon-core -am -Dtest=RESTPermissionStoreTest,ResourcePathsTest -Dsurefire.failIfNoSpecifiedTests=false testmvn -pl paimon-spark/paimon-spark-ut -am -DwildcardSuites=org.apache.paimon.spark.procedure.PermissionProcedureTest -Dtest=__NoSuchTest__ -Dsurefire.failIfNoSpecifiedTests=false testmvn -pl paimon-spark/paimon-spark-ut -am '-Dtest=SparkCatalogWithRestTest#testRowFilter+testColumnMaskingAndRowFilter' -DwildcardSuites=__NoSuchSuite__ -Dsurefire.failIfNoSpecifiedTests=false testnode docs/scripts/validate-rest-openapi.js